﻿<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="UTF-8">
<title>狗东商家后台</title>

<link rel="stylesheet" href="用户1/imgs/font-icon/iconfont.css">
<link rel="stylesheet" href="用户1/css/demo.css">
	<style type="text/css">
		@import url(../static/chat/css/demo.css);
		@import url(../static/chat/imgs/font-icon/iconfont.css);
		@import url(../static/admin/css/index_css/product.css);
		@import url(../static/admin/css/index_css/index-min.css);
		@import url(../static/admin/css/index_css/footer.css);
		@import url(../static/admin/css/index_css/normalize.css);
		@import url(../static/admin/css/index_css/base.css);
		@import url(../static/admin/css/style.css);
	</style>
	<!--[if lt IE 9]>
	<script src="../static/admin/js/html5.js"></script>
	<![endif]-->
	<script src="../static/admin/js/jquery.js"></script>
	<script src="../static/admin/js/jquery.mCustomScrollbar.concat.min.js"></script>


</head>
<body onload="openSocket()">
<div class="header" >
	<font size="5px">狗东商城后台管理</font>
	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

	<a href="" class="font" target="_blank">${shopName}</a>
	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
		<a href="#" class="font">${user}</a>&nbsp;${warning}

	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
	    <img src=""/>
		<a href="/login" class="font">安全退出</a>

	<div class="icon-box">
		<i class="iconfont icon">&#xe637;</i>
	</div>
</div>




<aside class="lt_aside_nav content mCustomScrollbar">

	<h2>${shopName}</h2>
	<ul>

		<li>
			<dl>
				<dt>店铺</dt>
				<dd><a href="/index" class="active">商品预览</a></dd>
				<dd><a href="/userInfo" class="active">店铺信息</a></dd>
			</dl>
		</li>

		<li>
			<dl>
				<dt>商品信息</dt>
				<!--当前链接则添加class:active-->
				<dd><a href="/product/list" class="active">商品列表</a></dd>
				<dd><a href="/product/add">添加商品</a></dd>
				<dd><a href="/product/under">下架的商品</a></dd>
			</dl>
		</li>
		<li>

		<li>
			<dl>
				<dt>设置活动</dt>
				<!--当前链接则添加class:active-->
				<dd><a href="/discount/secKill" class="active">发放优惠券</a></dd>
				<dd><a href="/discount/secKill">发放折扣</a></dd>
				<dd><a href="/discount/secKill">设置秒杀</a></dd>
			</dl>
		</li>
		<li>



			<dl>
				<dt>订单信息</dt>
				<dd><a href="/order/list">订单列表</a></dd>
<#--				<dd><a href="/order/detail?productId=1">订单详情</a></dd>-->
			</dl>
		</li>


		<li>
			<dl>
				<dt>配送与支付设置</dt>
				<dd><a href="/express/list">配送方式</a></dd>
				<dd><a href="/pay/support">支付方式</a></dd>
			</dl>
		</li>

		<li>
			<dl>
				<dt>我的评价</dt>
				<dd><a href="/evaluate/all">全部评价</a></dd>
			</dl>
		</li>
		<li>



		<li>

			<dl>
				<dt>在线统计</dt>
				<dd><a href="/statistical/data">流量统计</a></dd>
				<dd><a href="/statistical/money">销售额统计</a></dd>
			</dl>

		<li>
			<dl>
				<dt>账号设置</dt>
				<!--当前链接则添加class:active-->
				<dd><a href="/userInfo" class="active">修改个人信息</a></dd>
				<dd><a href="#">永久注销(暂不开放)</a></dd>
			</dl>
		</li>
		<li>

		</li>
		<li>
			<p class="btm_infor">© 狗东商城</p>
		</li>
	</ul>
</aside>


<section class="rt_wrap content mCustomScrollbar">
	<div class="j02 main clearfix" >
		<br>
		<#list products as product>
		<div class="product">
			<a href="/product/detail?productId=${product.id}" target="_blank" class="iwrap">
				<img src="../upload/${product.photo}">
				<p class="f16 line1">${product.name}</p>
				<span class="newRmb">￥${product.price?c}</span>
				<span class="oldRmb">原价￥${product.price?c}</span></br>
				<dd class="sell"></i>月售:${product.number}</dd>
			</a>
		</div>
	</#list>
	</div>

	<footer>
		<div class="footer">
			<div class="alt">
				<div class="foot">
					<p>关于作者</p>
					<a href="###">冯东旺</a>
					<a href="###">外包171</a>
					<a href="###">广药</a>
					<a href="###">2021届</a>
					<a href="###">毕业设计</a>
					<a href="###">SpringCloud</a>
					<a href="###">电商平台</a>

				</div>
				<div class="foot">
					<p>资源</p>
					<a href="###">生产者代码</a>
					<a href="###">消费者代码</a>
					<a href="###">注册中心代码</a>
					<a href="###">控制代码</a>
				</div>
				<div class="foot">
					<p>产品介绍</p>
					<a href="###">使用教程</a>
					<a href="###">产品思路</a>
				</div>
				<div class="foot">
					<p>友情链接</p>
					<a href="###">Eureka注册中心</a>
					<a href="###">商家管理中心</a>
					<a href="###">资源占用查看</a>
				</div>
				<div class="foot">
					<p>反馈</p>
					<a >作者邮箱：fdw_fdw@qq.com</a>
				</div>
				<div class="foot">
					<p>服务支持</p>
					<a href="###">gitee下载链接</a>
				</div>
				<div class="foot">
					<p>打赏作者</p>
					<img src="../static/pay_photo/wechat.jpg" width="128px" height="150px"/>
				</div>
				<div class="foot">
					<p> </p>
					<img src="../static/pay_photo/alipay.jpg" width="128px" height="150px"/>
				</div>
			</div>
			<div style="border-top:1px #1F1F1F solid;">
				<p class="alt" style="color:#999; line-height:0;">@ 开放协议：GPL    
					<span>作者：</span>
					<a href="###" target="_blank" style="color:#999;">冯东旺</a>
					<span style="float:right;">地址：广州大学城广药</span>
				</p>
			</div>
		</div>
	</footer>

</section>

<!--结束：以下内容则可删除，仅为素材引用参考-->
</div>

</section>
<script src="../static/admin/js/amcharts.js" type="text/javascript"></script>
<script src="../static/admin/js/serial.js" type="text/javascript"></script>
<script src="../static/admin/js/pie.js" type="text/javascript"></script>
</body>
<div class="chatbar">
	<div class="chatbar-box">
		<div class="chatbar-contacts">
			<div class="contacts-search-box">
				<i class="iconfont">&#xe651;</i>
				<input type="text" class="search-text" placeholder="请输入要搜索的联系人">
			</div>
			<ul class="chatbar-contacts-uls">
				<li>
					<i class="iconfont">&#xe752;</i>
					<p>黄小小</p>
				</li>

			</ul>
		</div>
		<div class="chatbar-messages">
			<div class="messages-title">
				<i class="iconfont">&#xe752;</i>
				<h4>黄小小</h4>
				<i class="iconfont return-icon">&#xe61a;</i>
			</div>
			<div class="messages-text" id="messages-text">

				</p><div><input id="userId" name="userId" type="hidden"> </div></p>
				</p><div><input id="toUserId" name="toUserId" type="hidden" ></div></p>
				<!--				</p>	<div><input id="contentText" name="contentText" ></div></p>-->
<#--				</p>	<div><a  onclick="openSocket()" >开启socket</a></div></p>-->
<#--				</p><div><a  onclick="sendMessage()">发送消息</a></div></p>-->
				</p><div id="message"></div></p>
				<script>
					document.getElementById("userId").value=localStorage.getItem('userName');
					document.getElementById("toUserId").value=localStorage.getItem('toUser');
				</script>

			</div>
			<div class="messages-box">
				<textarea class="messages-content" name="contentText" id="contentText" cols="30" rows="10"></textarea>
				<input class="message-btn" type="button" onclick="sendMessage()" value="发送" id="message-btn">
			</div>
		</div>
	</div>
</div>

<script src="../static/chat/js/jquery.min.js"></script>
<script src="../static/chat/js/demo.js"></script>
<script>
	var socket;
	function openSocket() {
		if(typeof(WebSocket) == "undefined") {
			setMessageInnerHTML("您的浏览器不支持WebSocket");
		}else{
			// setMessageInnerHTML("您的浏览器支持WebSocket");
			//实现化WebSocket对象，指定要连接的服务器地址与端口  建立连接
			var socketUrl="http://49.235.177.225:1061/ws/"+$("#userId").val();
			socketUrl=socketUrl.replace("https","ws").replace("http","ws");
			console.log(socketUrl);
			if(socket!=null){
				socket.close();
				socket=null;
			}
			socket = new WebSocket(socketUrl);
			//打开事件
			socket.onopen = function() {
				// setMessageInnerHTML("会话打开");
				//socket.send("这是来自客户端的消息" + location.href + new Date());
			};
			//获得消息事件
			socket.onmessage = function(msg) {
				setMessageInnerHTML(msg.data);
				//发现消息进入    开始处理前端触发逻辑
			};
			//关闭事件
			socket.onclose = function() {
				setMessageInnerHTML("会话已关闭");
			};
			//发生了错误事件
			socket.onerror = function() {
				setMessageInnerHTML("websocket发生了错误");
			}
		}
	}

	//将消息显示在网页上
	function setMessageInnerHTML(innerHTML){
		// document.getElementById('message').innerHTML+=innerHTML;
		// var str1 = eval('(' + innerHTML + ')');
		// var content = str1["contentText"];
		// var toUser=str1["toUserId"];
		write(localStorage.getItem('toUser'),innerHTML);
	}


	function sendMessage() {
		if (typeof (WebSocket) == "undefined") {
			setMessageInnerHTML("您的浏览器不支持WebSocket");
		} else {
			// setMessageInnerHTML("您的浏览器支持WebSocket");
			// setMessageInnerHTML('{"toUserId":"' + $("#toUserId").val() + '","contentText":"' + $("#contentText").val() + '"}');
			socket.send('{"toUserId":"' + $("#toUserId").val() + '","contentText":"' + $("#contentText").val() + '"}');
		}
	}
</script>

</body>
</html>
